import {post, get, request} from '../utils/request'

// 获取树洞列表
export const getMpTreeholeList = (pageNo = 1,pageSize = 10)=> {
  return get('/app-api/mp/open/treehole/list',{
    pageNo,pageSize
  })
}

// 小程序获取树洞详情
export const getMpTreeholeDetail = (id) => {
  return get('/app-api/mp/open/treehole/get',{id})
}

// 创建树洞
export function createTreehole(data) {
  return post('/app-api/mp/open/treehole/create',data)
}

// 根据班级id获取班级名称
export const getClassNameById = (id) =>{
  return get('/app-api/mp/open/classinfo/get',{id})
}
// 删除树洞
// export const deleteTreehole = (id) => {
//   return del('/app-api/mp/open/treehole/delete', { id })
// }
export const deleteTreehole = (id) => {
  return request({
    url: `/app-api/mp/open/treehole/delete?id=${id}`,
    method: 'DELETE'
  })
}
